﻿		
<link href='http://fonts.googleapis.com/css?family=Roboto+Slab' rel='stylesheet' type='text/css'>

<div class="row-fluid">
<h1 align="center" style="font-family: 'Roboto Slab', serif;font-weight: 400; color: #821212">Fedobe Wireframe Prototyping</h1>
<h3 align="center" style="font-family: 'Roboto Slab', serif;font-weight: 100; color: #666">Turn your hand-drawn wireframes to interactive prototypes</h3>
<div class="span4">
<h3 style="font-family: 'Roboto Slab', serif;font-weight: 100; color: #666">Add Page</h3>
<?php echo form_open_multipart('user/wireframe/add_tag/')?>
  <table>
  <tr><td>Page Name:</td>
  <td><input type="text" name="heading" placeholder="Name of the page..." /></td></tr>
  <tr><td>Parent:</td>
 <td><select name="parent"><option value="">Select Parent || None</option><?php $id=$this->session->userdata('user_id'); $sql = "SELECT * FROM tag_picture where user_id=$id"; $query = mysql_query($sql); while($rows=mysql_fetch_array($query)){ ?><option value="<?php echo $rows['id']; ?>"><?php echo $rows['heading']; ?></option><?php }?></select></td></tr>
  <tr><td>Upload Pic:</td>
 <td><input type="file" name="file" id="file" /></td></tr>
<tr><td></td><td><input type="submit" id="insert" value="Add" class="btn btn-info" /></td></tr>
</table>
</form>
</div>

<div class="span4">
	<!--Update form-->
<h3 style="font-family: 'Roboto Slab', serif;font-weight: 100; color: #666">Update</h3>
<?php echo form_open('user/wireframe/update_tag/')?>
<table>
<tr><td>Page Name:</td>
<td><select name="headingup"><option value="">Select Page</option><?php $id=$this->session->userdata('user_id'); $sql = "SELECT * FROM tag_picture where user_id=$id"; $query = mysql_query($sql); while($rows=mysql_fetch_array($query)){ ?><option value="<?php echo $rows['id']; ?>"><?php echo $rows['heading']; ?></option><?php }?></select></td></tr>

<tr><td>Parent:</td>
<td><select name="parentup"><option value="">Change Parent</option><?php $id=$this->session->userdata('user_id'); $sql = "SELECT * FROM tag_picture where user_id=$id"; $query = mysql_query($sql); while($rows=mysql_fetch_array($query)){ ?><option value="<?php echo $rows['id']; ?>"><?php echo $rows['heading']; ?></option><?php }?></select></td></tr>
<tr><td></td><td>
<input type="submit" name="update" id="update" class="btn btn-success" value="Update" />
</td></tr>
</table>
</form>
</div>

<div class="span3">
 <div class="imglist">
<h3 style="font-family: 'Roboto Slab', serif;font-weight: 100; color: #666">Site Map</h3>
   <ul style="list-style-type: none">
   <?php 
   $userid=$this->session->userdata('user_id');
    $sql = "SELECT * FROM tag_picture WHERE parent=0 and user_id=$userid ";
    $qry = mysql_query($sql);
    //$rs = mysql_fetch_array($qry);
  ?>
	<?php
	while($level1 = mysql_fetch_array($qry)){
		$id=$level1['id'];?>
		<li><b><a href="wireframe/tag_picture?pic_id=<?php echo $level1['id'] ?>">&rsaquo; <?php echo ucfirst($level1['heading']) ?></a></b></li>
		
		<?php
		$userid1=$this->session->userdata('user_id');	
		$sql1 = "SELECT * FROM tag_picture WHERE parent=$id and user_id=$userid1 ";
    	$query1 = mysql_query($sql1);
		while($level2 = mysql_fetch_array($query1)){
		$id2=$level2['id'];?>
		<li><b><a href="wireframe/tag_picture?pic_id=<?php echo $level2['id'] ?>">&nbsp;&nbsp;&nbsp;&nbsp;&rsaquo;&rsaquo; <?php echo ucfirst($level2['heading']); ?></a></b></li>
	
		<?php
		$userid2=$this->session->userdata('user_id');	
		$sql2 = "SELECT * FROM tag_picture WHERE parent=$id2 and user_id=$userid2 ";
    	$query2 = mysql_query($sql2);
		while($level3 = mysql_fetch_array($query2)){
		$id3=$level3['id'];?>
		<li><b><a href="wireframe/tag_picture?pic_id=<?php echo $level3['id'] ?>">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&rsaquo;&rsaquo;&rsaquo; <?php echo ucfirst($level3['heading']); ?></a></b></li>
		
		<?php
		$userid3=$this->session->userdata('user_id');	
		$sql3 = "SELECT * FROM tag_picture WHERE parent=$id3 and user_id=$userid3 ";
    	$query3 = mysql_query($sql3);
		while($level4 = mysql_fetch_array($query3)){
		$id4=$level4['id'];
		?>
		<li><b><a href="wireframe/tag_picture?pic_id=<?php echo $level4['id'] ?>">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&rsaquo;&rsaquo;&rsaquo;&rsaquo; <?php echo ucfirst($level4['heading']); ?></a></b></li>
		
		<?php
		$userid4=$this->session->userdata('user_id');	
		$sql4 = "SELECT * FROM tag_picture WHERE parent=$id4 and user_id=$userid4 ";
    	$query4 = mysql_query($sql4);
		while($level5 = mysql_fetch_array($query4)){
		?>
		<li><b><a href="wireframe/tag_picture?pic_id=<?php echo $level5['id'] ?>">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&rsaquo;&rsaquo;&rsaquo;&rsaquo;&rsaquo; <?php echo ucfirst($level5['heading']); ?></a></b></li>
		
		<?php
		}
		}
		}
				
	}
		
	}
	
	?>
	</ul>
  </div>
</div>
</div>

<div class="row-fluid">
	<div class="span3">
		
	</div>
	<div class="span4">
		<h3 style="font-family: 'Roboto Slab', serif;font-weight: 100; color: #666">Delete Page</h3>
<?php echo form_open('user/wireframe/delete_tag/')?>
<table>
<tr><td>
Page Name:</td><td><select name="headingd"><option value="">Select Page</option><?php $id=$this->session->userdata('user_id'); $sql = "SELECT * FROM tag_picture where user_id=$id"; $query = mysql_query($sql); while($rows=mysql_fetch_array($query)){ ?><option value="<?php echo $rows['id']; ?>"><?php echo $rows['heading']; ?></option><?php }?></select></td></tr>
<tr><td></td><td>
<input type="submit" name="delete" id="delete" value="Delete" class="btn btn-danger"/>
</td></tr>
</table>
</form>
	</div>
</div>